package com.xgkj.diyiketang.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.webkit.WebView;
import android.widget.TextView;

import com.xgkj.diyiketang.data.MessageInfo;
import com.xgkj.diyiketang.http.engine.ShowToastTaskEventListener;
import com.xgkj.diyiketang.task.SysMsgDetailTask;
import com.xgkj.diyiketang.R;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

/**
 * Created by Administrater on 2015/12/28.
 */
public class ZhuBoGongGaoDetailActivity extends BaseActivity {
    private Context mContext;
    private String mTitle;
    private String mNeiRong;
    private TextView msgTitle;
   // private TextView msgTime;
    private WebView msgContent;
    private TextView back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.zhubogonggaodetail);
        mContext=this;
        initView();
    }

    private void initView(){
        Intent intent = getIntent();
        mTitle = intent.getStringExtra("TITLE");
        mNeiRong = intent.getStringExtra("CONTENT");
         msgTitle = (TextView) findViewById(R.id.sys_title);
        msgContent = (WebView) findViewById(R.id.gonggao_content);
        msgTitle.setText(mTitle);

        if(!TextUtils.isEmpty(mNeiRong)){
            try {
                msgContent.loadDataWithBaseURL(null, URLDecoder.decode(mNeiRong,"utf-8"), "text/html", "charset=UTF-8", null);
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
        }
        back = (TextView) findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

    }


}
